package test.design_pattern.observer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

@Service
public class OrderService {

    @Autowired
    ApplicationContext applicationContext ;

    public void saveOrder(Order order){
        OrderEvent event = new OrderEvent(this, order);

        applicationContext.publishEvent(event);
    }
}
